<template>
    <el-select v-model="selectedValue" placeholder="All" @change="changeHandler" filterable >
        <el-option v-for="sd in props.dictData" 
        :key="sd.code" 
        :label="sd.name" 
        :value="sd.code"></el-option>
    </el-select>
</template>


<script setup>
import { onMounted } from 'vue';


const props = defineProps({

    modelValue: {
        type: Number,
        require: true,
        default: null
    },

    classCode: {
        type: String,
        require: true
    },

    dictData: {
        type: Array,
        require: true
    }


});

const selectedValue = ref(props.modelValue);
const emits = defineEmits(['update:modelValue']);

const changeHandler = (val) => {
    selectedValue.value = val;
    emits('update:modelValue', val);
}

onMounted(()=>{
   
});


</script>
